<?php
/**
 * communit.as
 * @copyright (C)2008 J. William McCarthy, All Rights Reserved.
 * @category communitas
 * @package communitas
 * @author J. William McCarthy
 * @link http://communit.as communit.as
 * @license http://communit.as/docs/license License
 */

/**
 *
 * @package communitas
 * @subpackage cms_plugins
 * @license http://communit.as/docs/license License 
 */

class Cms_Plugin{

	function init(){
		//register with application
		$ap = new App_Plugin();
		$ap->addFilter('index_pre_render','Cms_Plugin','addBlogContent',10);		
	}

	function addBlogContent($params){		
		$pages_table = new Cms_Pages();		
		$posts = $pages_table->fetchAll("type = 'post'",'posted_on desc',6);
		if(count($posts) > 0){
			$params['posts'] = $posts->toArray();
		}
		return $params;
	}	
}

